

import 'package:dk_flutter_base/dk_core.dart';

import 'bean_tools_item.dart';

class BeanToolsModule {
  CommonToolsModuleBean commonToolsModule;
  MoreToolsModlueBean moreToolsModlue;

  BeanToolsModule({this.commonToolsModule, this.moreToolsModlue});

  BeanToolsModule.fromJson(Map<String, dynamic> json) {    
    this.commonToolsModule = json['commonToolsModule'] != null ? CommonToolsModuleBean.fromJson(json['commonToolsModule']) : null;
    this.moreToolsModlue = json['moreToolsModlue'] != null ? MoreToolsModlueBean.fromJson(json['moreToolsModlue']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    if (this.commonToolsModule != null) {
      data['commonToolsModule'] = this.commonToolsModule.toJson();
    }
    if (this.moreToolsModlue != null) {
      data['moreToolsModlue'] = this.moreToolsModlue.toJson();
    }
    return data;
  }

}

class CommonToolsModuleBean {
  String moduleName;
  List<ToolsItem> tools;

  CommonToolsModuleBean({this.moduleName, this.tools});

  CommonToolsModuleBean.fromJson(Map<String, dynamic> json) {    
    this.moduleName = (json['moduleName'] is String) ? json['moduleName']:"";
    this.tools = (json['tools'] as List)!=null?(json['tools'] as List).map((i) => ToolsItem.fromJson(i)).toList():List();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['moduleName'] = this.moduleName;
    data['tools'] = this.tools != null?this.tools.map((i) => i.toJson()).toList():null;
    return data;
  }
}

class MoreToolsModlueBean {
  String moduleName;
  List<CategoryListBean> list;

  MoreToolsModlueBean({this.moduleName, this.list});

  MoreToolsModlueBean.fromJson(Map<String, dynamic> json) {    
    this.moduleName = (json['moduleName'] is String) ? json['moduleName']:"";
    this.list = (json['list'] as List)!=null?(json['list'] as List).map((i) => CategoryListBean.fromJson(i)).toList():List();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['moduleName'] = this.moduleName;
    data['list'] = this.list != null?this.list.map((i) => i.toJson()).toList():null;
    return data;
  }
}


class CategoryListBean {
  String categoryName;
  String categoryId;
  List<ToolsItem> tools;

  CategoryListBean({this.categoryName, this.categoryId, this.tools});

  CategoryListBean.fromJson(Map<String, dynamic> json) {    
    this.categoryName = json['categoryName'] ?? "";
    this.categoryId = json['categoryId'] ?? "";
    this.tools = (json['tools'] as List)!=null?(json['tools'] as List).map((i) => ToolsItem.fromJson(i)).toList():List();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['categoryName'] = this.categoryName;
    data['categoryId'] = this.categoryId;
    data['tools'] = this.tools != null?this.tools.map((i) => i.toJson()).toList():null;
    return data;
  }
}
